home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 14290 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  765 b 

  1. Path: mail2news.demon.co.uk!escan.demon.co.uk
  2. From: Bill Birrell <bill@escan.demon.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: A weird thing about printf()
  5. Date: Fri, 12 Apr 1996 10:10:00
  6. Message-ID: <829297581.AA00180@escan.demon.co.uk>
  7. Reply-To: bill@escan.demon.co.uk
  8. X-NNTP-Posting-Host: escan.demon.co.uk
  9. X-Mail2News-Path: escan.demon.co.uk
  10.  
  11.  >   The program :
  12.  
  13.  > #include <stdio.h>
  14.  
  15.  > int answer;
  16.  > main()
  17.  > {
  18.  >   answer=2+2;
  19.  >   printf("The answer is %d\n");
  20.  >   return 0;
  21.  > }
  22.  
  23.     Are you kidding? if you want parameter substitution you have to have
  24. parameters - the compiler is not expected to read your mind - so you needed to
  25. have written:-
  26.  
  27.     printf("The answer is %d\n", answer);
  28.  
  29. --
  30. Regards,
  31. Bill Birrell.
  32. internet:       bill@escan.demon.co.uk
  33.